<form nz-form [formGroup]="validateForm" class="login-form" (ngSubmit)="submitForm()">
  <h2>登录</h2>
  <nz-form-item>
    <nz-form-control>
      <nz-input-group [nzPrefix]="prefixUser">
        <input type="text" nz-input formControlName="username" placeholder="请输入用户名">
      </nz-input-group>
      <nz-form-explain *ngIf="username.invalid && username.dirty">
        <ng-container *ngIf="username.hasError('required')">请输入用户名</ng-container>
        <ng-container *ngIf="username.hasError('minlength')">长度必须大于5个字符</ng-container>
      </nz-form-explain>
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-control>
      <nz-input-group [nzPrefix]="prefixLock">
        <input type="password" nz-input formControlName="password" placeholder="请输入密码">
      </nz-input-group>
      <nz-form-explain *ngIf="password.invalid && password.dirty">请输入密码</nz-form-explain>
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-control>
      <label nz-checkbox formControlName="remember">
        <span>记住我</span>
      </label>
      <a class="login-form-forgot" class="login-form-forgot">忘记密码</a>
      <button nz-button [nzLoading]="isLoading" nzType="primary" class="login-form-button">登录</button>
    </nz-form-control>
  </nz-form-item>
</form>
<ng-template #prefixUser><i nz-icon type="user"></i></ng-template>
<ng-template #prefixLock><i nz-icon type="lock"></i></ng-template>